<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	
	<link rel="stylesheet" type="text/css" href="../../css/base.css" />
	<link id="easyuiTheme"  rel="stylesheet" type="text/css" href="../../easy-ui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="../../easy-ui/themes/icon.css">
	<script type="text/javascript" src="../../easy-ui/jquery.min.js"></script>
	<script type="text/javascript" src="../../easy-ui/jquery.easyui.min.js"></script>
	<script type="text/javascript" src="../../js/base.js" ></script>
	<script type="text/javascript" src="../../js/ajaxfileupload.js" ></script>

      <style type="text/css">
    body,html,div,ul,li,span,p,input,form,label,a,img,em,dl,dt,dd,textarea,h3,table,th,td,tr{margin:0;padding:0;font-size:12px;font-family:"'微软雅黑 ', '微软雅黑'"!important;list-style:none;font-style:normal;word-break: break-all;word-wrap: break-word;}
	input[type="text"]::-ms-clear{display:none;}
	input[type="radio"],input[type="checkbox"]{cursor:pointer;vertical-align:middle;}
	.fl{float:left;}
	.fr{float:right;}
	.oh{overflow:hidden;}
	.table-gray{background: #f8f8f8;text-align: right;line-height: 20px;}
	.myTable{ padding: 30px; border: 1px solid #c9c9c9;}
	.td-span{padding-left: 15px;}
	.myTable>table{width: 100%; border-top: 1px solid #c9c9c9; border-right: 1px solid #c9c9c9;}
	.myTable>table>tbody>tr{overflow: hidden;}
	.myTable>table>tbody>tr>td{border-left: 1px solid #c9c9c9;border-bottom: 1px solid #c9c9c9;padding:10px;}
	.myTable>table>tbody>tr>td>input{height: 24px;width: 80px;}
	.myTable>table>tbody>tr>td>select{width: 100%;}
	.myTable>table>tbody>tr>td>textarea{width: 100%;}
	.td-sec{margin: 8px 8px;}
	.td-sec>span{padding-right: 8px;}
	.td-sec>span>input{width: 60px;}
	.td-a{display: block;background: #0d73b4;width: 75px;height: 24px;line-height: 24px;text-align: center;
	border-radius: 5px;-moz-border-radius: 5px;-ms-border-radius: 5px;-webkit-border-radius: 5px;-o-border-radius:5px;
	color: #fff}
	.td-third>textarea{width: 85%; height: 80px;margin-left: 8px;}
	.table-solo{overflow: hidden;text-align: center;}
	.table-solo>td{border: 1px solid #C9C9C9;padding: 5px;}
	    
    
    </style>
</head>


<body class="easyui-layout" data-options="fit:true" style="overflow:hidden;">
	
		<!-- 表单提交-->
		<div data-options="region:'south',border:false," style="height:40px;text-align:center;">

			  <table style="width:100%;margin-top:8px;" >
							<tr>
							<td style="align:center;">
								<a href='javascript:void(-1);' onclick="curTabClose();";  class="easyui-linkbutton" data-options="iconCls:'icon-cancel'">关闭</a>
							</td>
							</tr>
				</table>
		</div>
	
		<div data-options="region:'center',border:true,">
		
		<!-- the baseForm start  -->
		<form id="baseForm" name="baseForm" method="post" target="hiddenFrame" style="margin:0px;padding:0px;overflow:hidden;">
		<input id="id" name="id" type="hidden" /> 
		
		<div class="myTable">
				  <table cellpadding="0" cellspacing="0">
				    <tbody>
				      <tr>
				        <td class="table-gray" width="10%" >活动标题：</td>
				        <td colspan="3">
				        <input  name="header" id="header"  type="text" style="width: 100%;" class="easyui-validatebox textbox" data-options="required:true,novalidate:true">
				        </td>
				       
				      </tr>
				     <tr>
				        <td class="table-gray">活动店铺：</td>
				        <td ><div class="td-sec"></div>
				          	<input id="shopName" name="shopName" style="width: 100%;" class="easyui-validatebox textbox" ></input>
				        </td>
				        <td class="table-gray">状态：</td>
				        <td >
				          	<input id="status" name="status" style="width: 100%;" class="easyui-validatebox textbox" ></input>
				        </td>
				      </tr>
				     <tr>
				     
				     <tr>
				        <td class="table-gray">开始时间：</td>
				        <td ><div class="td-sec"></div>
				          	<input id="startTime" name="startTime" style="width: 100%;" class="easyui-validatebox textbox" ></input>
				        </td>
				        <td class="table-gray">结束时间：</td>
				        <td >
				          	<input id="endTime" name="endTime" style="width: 100%;" class="easyui-validatebox textbox" ></input>
				        </td>
				      </tr>
				     <tr>
				     <tr>
				        <td class="table-gray">创建人：</td>
				        <td ><div class="td-sec"></div>
				          	<input id="createUser" name="createUser" style="width: 100%;" class="easyui-validatebox textbox" ></input>
				        </td>
				        <td class="table-gray">创建时间：</td>
				        <td >
				          	<input id="createTime" name="createTime" style="width: 100%;" class="easyui-validatebox textbox" ></input>
				        </td>
				      </tr>
				     <tr>
				        <td class="table-gray">审核人：</td>
				        <td ><div class="td-sec"></div>
				          	<input id="checkUser" name="checkUser" style="width: 100%;" class="easyui-validatebox textbox" ></input>
				        </td>
				        <td class="table-gray">审核时间：</td>
				        <td >
				          	<input id="checkTime" name="checkTime" style="width: 100%;" class="easyui-validatebox textbox" ></input>
				        </td>
				      </tr>
				    
				     <tr>
				        <td class="table-gray">活动描述：</td>
				        <td colspan="3"><div class="td-sec"></div>
				          	<textarea rows="5" cols="7" id="des" name="des"></textarea>
				        </td>
				        
				      </tr>
				     <tr>
				        <td class="table-gray"> 活动图片：</td>
				        <td>
							<div  style="width:100%;" class="panel-body panel-body-noheader" >
							 	<table border="0" style="width:100%;" >
							 		<tr >
										<td style="width:5px;">
										
										</td>
										
										<td style="align:center;height:85px;" id="imgUrl">
											
										</td>
								
										<td style="width:5px;" style="">
											&nbsp;
										</td>
									</tr>
								</table>
							</div>
					        </td>
					       
				      </tr>
				     
				    
				     
				    </tbody>
				  </table>
				</div>
			</form>
			
			<!-- the dataForm end  -->
			
		</div>
	
	

	<script type="text/javascript">

		
		function initPage(id){
			 
			 parent.showProgressing();
			 document.getElementById('id').value=eval('parent.parent.'+getQueryString('targetFrame')+'.mainFrame_id.selections[0].id');
			 parent.showProgressing();
			 sendRequestAjax('../../zcactivity/initView.do?responseFunction=initUpdate&',initUpdate);
			
			 
		}
		
		window.onload=function(){
			
			initPage();
		}
		
		var responseResultPage;
		function initUpdate(responseResult){
			setFormDefault(responseResult); 
			
			
			responseResultPage=responseResult;
			
			
			if(responseResult.entity.imgUrl!=''){
				document.getElementById("imgUrl").innerHTML="<img src='"+responseResult.entity.imgUrl+"' style='height:80px;'></img>";	
			}else{
				document.getElementById("imgUrl").innerHTML="";
			}
			
			if(responseResult.entity.checkTime !== null && responseResult.entity.checkTime !==''){
				$("#checkTime").val(switchTime(responseResult.entity.checkTime,2));
			}
			if(responseResult.entity.createTime !== null && responseResult.entity.createTime !==''){
				$("#createTime").val(switchTime(responseResult.entity.createTime,2));
			}
			if(responseResult.entity.startTime !== null && responseResult.entity.startTime !==''){
				$("#startTime").val(switchTime(responseResult.entity.startTime,2));
			}
			if(responseResult.entity.endTime !== null && responseResult.entity.endTime !==''){
				$("#endTime").val(switchTime(responseResult.entity.endTime,2));
			}
			
			parent.closeProgressing();  
			
			//disableForm("baseForm");
		}
		
		
	
		//form表单 提交 重置 提交后响应处理 ----------------
		
		
		
		
		function baseFormSubmit(){
			parent.showProgressing();
			sendRequestAjax('../../zcactivity/updateSave.do?responseFunction=updateSave',updateSave)
			
		}
		
		
		function  baseFormReset(){
			
			 initUpdate(responseResultPage);
			
		}
		
		function updateSave(responseResult){
		    executeWindowCallback( {});
			
			if(responseResult.slide_msg_key==1){
				parent.parent.showSlideMsg(responseResult.slide_msg_message_key);
			}
			parent.closeProgressing();
			
			//关闭当前tab
 			var currentTab =parent.parent.$('#tabs').tabs('getSelected');
            var currtab_title = currentTab.panel('options').title;
            var currtab_id = currentTab.panel('options').id;
            if(currtab_id!='index_welcome_id'){
           		 parent.parent.$('#tabs').tabs('close', currtab_title);
            }
			

			
		}
		
		function curTabClose(){
		
			//关闭当前tab
 			var currentTab =parent.parent.$('#tabs').tabs('getSelected');
            var currtab_title = currentTab.panel('options').title;
            var currtab_id = currentTab.panel('options').id;
            if(currtab_id!='index_welcome_id'){
           		 parent.parent.$('#tabs').tabs('close', currtab_title);
            }
		}
		//form表单 提交 重置 提交后响应处理结束 ------------
		function baseFormFileUp(){
			parent.showProgressing();
	//		sendFileUploadRequestAjax('../../contentFileUp/fileUp.do?responseFunction=upFileSuc',upFileSuc,'upFile');
			sendFileUploadParam('../../contentFileUp/fileUp.do?responseFunction=upFileSuc',{restrictType:'0',restricts:[{value:'jpg'},{value:'gif'},{value:'png'},{value:'bmp'}]},upFileSuc,'upFile');
		}
		
		function upFileSuc(responseResult){
			document.getElementById("viewPic").innerHTML="";
			document.getElementById("titleImg").value=responseResult.attachmentUrl;
			document.getElementById("viewPic").innerHTML="<img src='../../"+responseResult.attachmentUrl+"' style='height:80px;'></img>";	
			parent.closeProgressing();
		}
			
	</script>


	

</body>
</html>